/*************************************************************************
	> File Name: test9.c
	> Author: H.M. Lau
	> Mail: hm.lau@outlook.com
	> Created Time: 2023/09/02 23:10
 ************************************************************************/

#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

void myperror(const char *msg)
{
    fprintf(stderr, "%s:%s\n", msg, strerror(errno));
}

int main(int argc, char *argv[])
{
    int fd = open("log.txt", O_RDONLY);
    if (fd < 0) {
        myperror("open");
        return 1;
    }
    return 0;
}
